Skip to content

Comments

treewide: Follow rule of five#14791

Merged
xokdvium merged 4 commits intomasterfrom
fix-special-member-functions-a-lot
Dec 16, 2025
Merged

treewide: Follow rule of five#14791
xokdvium merged 4 commits intomasterfrom
fix-special-member-functions-a-lot

Conversation

@xokdvium
Copy link
Contributor

Motivation

Good to explicitly declare things to not accidentally do twice the work by
preventing that kind of misuse.
This is essentially just cppcoreguidelines-special-member-functions lint
in clang-tidy.

Context

Pulled out PathLocks changes from #14788, but with explicit implementations instead of explicitly defaulting.


Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

Ericson2314 and others added 2 commits December 15, 2025 00:36
No copying allowed

Co-authored-by: Sergei Zimmerman <sergei@zimmerman.foo>
These can't be copied and moving requires special logic too.
Good to explicitly declare things to not accidentally do twice the work by
preventing that kind of misuse.
This is essentially just cppcoreguidelines-special-member-functions lint
in clang-tidy.
@xokdvium xokdvium force-pushed the fix-special-member-functions-a-lot branch from f38aebe to 1986287 Compare December 14, 2025 22:35
Copy link
Member

@Ericson2314 Ericson2314 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve, but why not do the default move constructors when it works? That part I don't understand.

@Ericson2314 Ericson2314 added this pull request to the merge queue Dec 15, 2025
github-merge-queue bot pushed a commit that referenced this pull request Dec 15, 2025
Copy link
Contributor

@tomberek tomberek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not having these be explicit has often confused me. It's a style thing that ends up having contribution impacts.

@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Dec 15, 2025
@Ericson2314 Ericson2314 added this pull request to the merge queue Dec 15, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Dec 15, 2025
@xokdvium xokdvium added this pull request to the merge queue Dec 16, 2025
Merged via the queue into master with commit a38fc65 Dec 16, 2025
20 checks passed
@xokdvium xokdvium deleted the fix-special-member-functions-a-lot branch December 16, 2025 01:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants